﻿/***************************************************
 * File name: Sale.cs 
 * Author: Team A
 * Change Log: Please see SVN repository: http://test-project-drew1.googlecode.com/svn/trunk/
 * Date: December 2013
 * Description: See <summary> tab below
 * *************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace WSCeCommerce.Domain
{
    /// <summary>
    /// Represents a sale to a user.
    /// </summary>
    public class Sale
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public Sale()
        {
            SaleItems = new List<SaleItem>();
        }


             /// <summary>
        /// Unique ID used for database purposes
        /// </summary>
        public int SaleId
        {
            get;
            set;
        }

        /// <summary>
        /// Date the sale was created
        /// </summary>
        public DateTime Date
        {
            get;
            set;
        }

        /// <summary>
        /// User associated with the sale.
        /// </summary>
        public int UserId
        {
            get;
            set;
        }


        /// <summary>
        /// A list of items contained in the sale.
        /// </summary>
        public ICollection<SaleItem> SaleItems
        {
            get;
            set;
        }


        /// <summary>
        /// Address of where to ship the items to. This may or may not be the same as the User's address
        /// </summary>

        public Address ShipToAddress
        {
            get;
            set;
        }

        public float Total
        { get; set; }
        [Required]
        public CreditCardTypes CardType { get; set; }
        [Required]
        [Display(Name = "Card Number")]
        public string CardNumber { get; set; }
    }
}
